const mongoose = require('mongoose')
mongoose.connect("mongodb://localhost:27017/db_bs")
const db =mongoose.connection
db.on('error',(err)=>{
    console.log('数据库链接失败',err)
})

db.on('open',()=>{
    console.log('数据库链接成功')
})